package com.lagou.edu.kubernetes.controller;

import com.lagou.edu.kubernetes.common.WebResult;
import com.lagou.edu.kubernetes.pojo.Position;
import com.lagou.edu.kubernetes.service.IPositionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@RequestMapping("/position")
public class PositionController {

    @Autowired
    IPositionService positionService;

    @RequestMapping(value = "/listAll", produces = {"application/json;charset=UTF-8"}, method = RequestMethod.GET)
    public WebResult<List<Position>> say() {
        WebResult<List<Position>> result = new WebResult<>();
        result.setData(positionService.findAll());
        return result;
    }
}

